package com.amiu.util;

import com.amiu.shiro.db.user.User;

/**
 * 项目标准加密密码规范
 * @author amiu
 * @version createtime：2017-9-5 上午10:11:32
 */
public class StandardPasswordHelper {
	
	/**
	 * MD5算法，加密2次 
	 */
	public static String encryptPassword(String password,String salt){
		return PasswordHelper.encryptPassword(2, password, salt);
	}
	
	public static void encryptPassword(User user){
		String pwdWithSalt = PasswordHelper.encryptPassword(2, user.getPassword(), user.getPassword_salt());
		user.setPassword(pwdWithSalt);
	}
	
}
